/*
 *      Author: Guannan Ma
 *      @mythmgn
 *      Whatever license applied
 */

#include "base.h"

#ifndef _BASE_LIB_GETCONF_H_
#define _BASE_LIB_GETCONF_H_

#ifdef __cplusplus
extern "C"
{
#endif

    typedef struct conf_param_item {
        char * key;
        char * value;
    } conf_param_item;

#define CONF_MUST 0
#define CONF_OPTIONAL 1
#define CONF_BEGIN_PARAM 3
#define CONF_END_PARAM 4

#define CONF_PARAM_NUMBER 2

    typedef struct conf {
        struct conf* next;
        conf_param_item *cpi;
    } conf;


    BOOL
    initConf(char *topDIR);
    BOOL
    checkConfServer(hTab *hconf);
    void
    freeConfItem(void *content);
    BOOL
    closeConf(hTab *hconf);
    hTab*
    getCurrentConfHtab();
    BOOL
    setCurrentConfHtab(hTab *ph);
    char *
    getConfItem(const char *key);

#ifdef __cplusplus
}
#endif

#endif  /* GETCONF_H_INCLUDED */
